﻿
using System.Windows;
using System.Windows.Media;

namespace Lib.WPF.Dependents;

/// <summary>
/// 鼠标离开时附加属性（Color,Background,CornerRadius,Opacity,Image,Source,Margin,Padding,Size,Width,Height,Angle）
/// </summary>
public class MouseLeave  {

    /// <summary>
    /// 前景色属性
    /// </summary>
    public static readonly DependencyProperty ColorProperty = DependencyProperty.RegisterAttached("Color", typeof(Brush), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取前景色
    /// </summary>
    public static Brush GetColor(DependencyObject e) => (Brush)e.GetValue(ColorProperty);
    /// <summary>
    /// 设置前景色
    /// </summary>
    public static void SetColor(DependencyObject e, Brush Value) => e.SetValue(ColorProperty, Value);


    /// <summary>
    /// 背景色属性
    /// </summary>
    public static readonly DependencyProperty BackgroundProperty = DependencyProperty.RegisterAttached("Background", typeof(Brush), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取背景色
    /// </summary>
    public static Brush GetBackground(DependencyObject e) => (Brush)e.GetValue(BackgroundProperty);
    /// <summary>
    /// 设置背景色
    /// </summary>
    public static void SetBackground(DependencyObject e, Brush Value) => e.SetValue(BackgroundProperty, Value);


    /// <summary>
    /// 圆角半径属性
    /// </summary>
    public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached("CornerRadius", typeof(CornerRadius), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取圆角半径
    /// </summary>
    public static CornerRadius GetCornerRadius(DependencyObject e) => (CornerRadius)e.GetValue(CornerRadiusProperty);
    /// <summary>
    /// 设置圆角半径
    /// </summary>
    public static void SetCornerRadius(DependencyObject e, CornerRadius Value) => e.SetValue(CornerRadiusProperty, Value);


    /// <summary>
    /// 透明度属性
    /// </summary>
    public static readonly DependencyProperty OpacityProperty = DependencyProperty.RegisterAttached("Opacity", typeof(double), typeof(MouseLeave), new PropertyMetadata(1.0));
    /// <summary>
    /// 获取透明度
    /// </summary>
    public static double GetOpacity(DependencyObject e) => (double)e.GetValue(OpacityProperty);
    /// <summary>
    /// 设置透明度
    /// </summary>
    public static void SetOpacity(DependencyObject e, double Value) => e.SetValue(OpacityProperty, Value);



    /// <summary>
    /// 图形对象属性
    /// </summary>
    public static readonly DependencyProperty ImageProperty = DependencyProperty.RegisterAttached("Image", typeof(Geometry), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取图形对象
    /// </summary>
    public static Geometry GetImage(DependencyObject e) => (Geometry)e.GetValue(ImageProperty);
    /// <summary>
    /// 设置图形对象
    /// </summary>
    public static void SetImage(DependencyObject e, Geometry Value) => e.SetValue(ImageProperty, Value);


    /// <summary>
    /// 图片路径属性
    /// </summary>
    public static readonly DependencyProperty SourceProperty = DependencyProperty.RegisterAttached("Source", typeof(ImageSource), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取图片路径
    /// </summary>
    public static ImageSource GetSource(DependencyObject e) => (ImageSource)e.GetValue(SourceProperty);
    /// <summary>
    /// 设置图片路径
    /// </summary>
    public static void SetSource(DependencyObject e, ImageSource Value) => e.SetValue(SourceProperty, Value);



    /// <summary>
    /// 外部边距属性
    /// </summary>
    public static readonly DependencyProperty MarginProperty = DependencyProperty.RegisterAttached("Margin", typeof(Thickness), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取外部边距
    /// </summary>
    public static Thickness GetMargin(DependencyObject e) => (Thickness)e.GetValue(MarginProperty);
    /// <summary>
    /// 设置外部边距
    /// </summary>
    public static void SetMargin(DependencyObject e, Thickness Value) => e.SetValue(MarginProperty, Value);


    /// <summary>
    /// 内部边距属性
    /// </summary>
    public static readonly DependencyProperty PaddingProperty = DependencyProperty.RegisterAttached("Padding", typeof(Thickness), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取内部边距
    /// </summary>
    public static Thickness GetPadding(DependencyObject e) => (Thickness)e.GetValue(PaddingProperty);
    /// <summary>
    /// 设置内部边距
    /// </summary>
    public static void SetPadding(DependencyObject e, Thickness Value) => e.SetValue(PaddingProperty, Value);



    /// <summary>
    /// 大小属性
    /// </summary>
    public static readonly DependencyProperty SizeProperty = DependencyProperty.RegisterAttached("Size", typeof(double), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取大小
    /// </summary>
    public static double GetSize(DependencyObject e) => (double)e.GetValue(SizeProperty);
    /// <summary>
    /// 设置大小
    /// </summary>
    public static void SetSize(DependencyObject e, double Value) => e.SetValue(SizeProperty, Value);


    /// <summary>
    /// 宽度属性
    /// </summary>
    public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached("Width", typeof(double), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取宽度
    /// </summary>
    public static double GetWidth(DependencyObject e) => (double)e.GetValue(WidthProperty);
    /// <summary>
    /// 设置宽度
    /// </summary>
    public static void SetWidth(DependencyObject e, double Value) => e.SetValue(WidthProperty, Value);



    /// <summary>
    /// 高度属性
    /// </summary>
    public static readonly DependencyProperty HeightProperty = DependencyProperty.RegisterAttached("Height", typeof(double), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取高度
    /// </summary>
    public static double GetHeight(DependencyObject e) => (double)e.GetValue(HeightProperty);
    /// <summary>
    /// 设置高度
    /// </summary>
    public static void SetHeight(DependencyObject e, double Value) => e.SetValue(HeightProperty, Value);



    /// <summary>
    /// 角度属性
    /// </summary>
    public static readonly DependencyProperty AngleProperty = DependencyProperty.RegisterAttached("Angle", typeof(double), typeof(MouseLeave), new PropertyMetadata(default));
    /// <summary>
    /// 获取角度
    /// </summary>
    public static double GetAngle(DependencyObject e) => (double)e.GetValue(AngleProperty);
    /// <summary>
    /// 设置角度
    /// </summary>
    public static void SetAngle(DependencyObject e, double Value) => e.SetValue(AngleProperty, Value);


}
